New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ledger] Fix ledger rollover scheduled task #11116
Merged
sijie
merged 3 commits into
apache:master
from
gaoran10:fix-ledger-rollover-scheduler-task
Jul 2, 2021
Merged
[Ledger] Fix ledger rollover scheduled task #11116
sijie
merged 3 commits into
apache:master
from
gaoran10:fix-ledger-rollover-scheduler-task
Jul 2, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gaoran10
requested review from
codelipenghui,
315157973,
congbobo184,
eolivelli,
zymap,
jiazhai,
merlimat and
sijie
June 26, 2021 17:24
315157973
reviewed
Jun 27, 2021
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
Show resolved
Hide resolved
315157973
reviewed
Jun 27, 2021
managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
Outdated
Show resolved
Hide resolved
@gaoran10 does this affect docs? |
Hi @gaoran10 any feedback? |
Sorry late response, this is not affect doc. |
…a new ledger has been created successfully.
gaoran10
force-pushed
the
fix-ledger-rollover-scheduler-task
branch
from
June 29, 2021 11:04
8d42418
to
eadebdc
Compare
eolivelli
approved these changes
Jun 30, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
315157973
approved these changes
Jun 30, 2021
sijie
approved these changes
Jun 30, 2021
codelipenghui
pushed a commit
that referenced
this pull request
Jul 7, 2021
### Motivation Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time. ### Modifications Only make the ledger rollover scheduled task after the ledger created successfully. If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover. ### Verifying this change Add a unit test to verify the ledger could be rolled over in time. (cherry picked from commit a092ceb)
codelipenghui
pushed a commit
that referenced
this pull request
Jul 9, 2021
The PR #11116 couldn't be cherry-picked to `branch-2.7`, because there are too many conflicts. In PR #8946 the ledger rollover task had been moved from `BrokerService` to `ManagedLedgerImpl`, and this PR is based on it. ### Motivation Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time. ### Modifications Only make the ledger rollover scheduled task after the ledger created successfully. If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
### Motivation Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time. ### Modifications Only make the ledger rollover scheduled task after the ledger created successfully. If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover. ### Verifying this change Add a unit test to verify the ledger could be rolled over in time.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
cherry-picked/branch-2.7
Archived: 2.7 is end of life
cherry-picked/branch-2.8
Archived: 2.8 is end of life
doc-not-needed
Your PR changes do not impact docs
release/2.7.3
release/2.8.1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, the ledger rollover scheduled task will execute before reach the ledger maximum rollover time, this will cause the ledger doesn't roll over in time.
Modifications
Only make the ledger rollover scheduled task after the ledger created successfully.
If the scheduled task was executed when there is no entry in the current ledger, the scheduled task will not be re-executed, and if there is new entry is added the ledger will rollover.
Verifying this change
Add a unit test to verify the ledger could be rolled over in time.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changes